const sendResponse = (res, { code = 200, message = 'Success', data = null }) => {
  const ok = code >= 200 && code < 300; // 根据 code 自动判断 ok 值
  res.status(code).json({ code, message, ok, data });
};

module.exports = sendResponse;